//- Copyright (C) 2018-2022 Chatopera Inc, <https://www.chatopera.com>
//- 
//- Licensed under the Apache License, Version 2.0 (the "License");
//- you may not use this file except in compliance with the License.
//- You may obtain a copy of the License at
//- 
//-  http://www.apache.org/licenses/LICENSE-2.0
//- 
//-  Unless required by applicable law or agreed to in writing, software
//- distributed under the License is distributed on an "AS IS" BASIS,
//-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//- See the License for the specific language governing permissions and
//- limitations under the License.
include /mixins/dic.mixin.pug

.uk-layui-form
    form.layui-form(action="/apps/customer/impsave.html", enctype="multipart/form-data", method="post")
        .layui-collapse
            .layui-colla-item
                h2.layui-colla-title 选择导入的数据文件
                .layui-colla-content.layui-show
                    .layui-form-item
                        .layui-inline
                            label.layui-form-label 数据文件：
                            .layui-input-inline
                                .layui-box.layui-upload-button(style="width: 100%;")
                                    input.layui-upload-file(type="file", name="cusfile", required="", lay-verify="required", accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", lay-ext="jpg|png|gif", onchange="$('#cus_file').html($(this).val());")
                                    span.layui-upload-icon
                                        i.layui-icon 
                        .layui-inline
                            font(color="red") *（必填项）
                            |  (需要导入的客户数据Excel文件，可以是多个Sheet页)
                            a(href="/res/template.html?filename=customer_template.xls", target="_blank", style="margin-left:20px;")
                                i.layui-icon 
                                |                                        下载模板
                    .layui-form-item(style="height:40px;line-height:40px;")
                        .layui-inline
                            label.layui-form-label
                            #cus_file.layui-input-inline(style="width:500px;")
            .layui-colla-item
                h2.layui-colla-title 客户信息导入说明，导入步骤：
                .layui-colla-content.layui-show
                    .layui-form-item
                        .layui-inline
                            label#cusname1.layui-form-label 第一步：
                            .layui-input-inline(style="width:auto;padding-top:9px;") 上传客户数据的Excel文件（支持多Sheet页导入）
                    .layui-form-item
                        .layui-inline
                            label#cusname2.layui-form-label 第二步：
                            .layui-input-inline(style="width:auto;padding-top:9px;") 选择Excel里的列与系统客户的字段对应关系
                    .layui-form-item
                        .layui-inline
                            label#cusname3.layui-form-label 第三步：
                            .layui-input-inline(style="width:auto;padding-top:9px;") 开始导入客户数据
            .ukefu-imp-tips
                | 自动匹配客户导入字段功能，无需下载模板，系统自动匹配，客户数据直接导入，使用更加方便、快捷、智能。
        .layui-form-button
            .layui-button-block
                button.layui-btn(lay-submit="", lay-filter="formDemo") 立即导入
                button.layui-btn.layui-btn-original(type="reset") 重置
script.
    layui.use('upload', function () {
        var target = $(this).attr("data-target");
    });
    layui.use('form', function () {
        var form = layui.form();
        form.render();
    });
